package com.zimin.cloud.wiki.api;

import com.zimin.cloud.mine.pojo.wiki.business.DocBO;
import com.zimin.shared.pojo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author zimin
 */
@FeignClient(name = IBaseWikiFeign.SERVER_NAME)
public interface IDocFeign {

    /**
     * 获取文档列表
     *
     * @param docBO 请求参数
     */
    @GetMapping(value = "/wiki/docs")
    Result docList(@SpringQueryMap DocBO docBO);


    /**
     * <p>保存文档</p>
     *
     * @param docBO 保存参数
     * @return com.zimin.cloud.shared.pojo.Result
     * @since 2021-11-02 18:01:48
     */
    @PostMapping(value = "/wiki/doc")
    Result saveDoc(@RequestBody @Validated DocBO docBO);

    /**
     * <p>修改文档</p>
     *
     * @param docBO 修改文档参数
     * @return com.zimin.cloud.shared.pojo.Result
     * @since 2021-11-02 18:02:03
     */
    @PutMapping(value = "/wiki/doc")
    Result updateDoc(@RequestBody @Validated DocBO docBO);

    /**
     * <p>根据ID删除文档</p>
     *
     * @param id 要删除的id
     * @return com.zimin.cloud.shared.pojo.Result
     * @since 2021-11-02 18:02:21
     */
    @DeleteMapping("/wiki/doc/{ids}")
    Result removeDocById(@PathVariable(value = "ids") String ids);

    /**
     * <p>获取所有的文档树</p>
     *
     * @param docBO 文档对象
     * @return com.zimin.shared.pojo.Result
     * @since 2021-11-22 17:36:49
     */
    @GetMapping("/wiki/doc/all")
    Result docAll(@SpringQueryMap  DocBO docBO);

    /**
     * <p>根据ID获取文档</p>
     *
     * @param id
     * @return com.zimin.shared.pojo.Result
     * @since 2021-12-24 11:04:45
     */
    @GetMapping("/wiki/doc/{id}")
    Result getDocContent(@PathVariable(value = "id")String id);
}
